import "package:flutter/material.dart";

class Widget_Align_Page extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text("Align"),
        ),
        body:ListView(
          children: <Widget>[
            Container(
              color: Color(0xfff1f1f1),
              child: Align(
                alignment: FractionalOffset.bottomRight,
                child: Text("FractionalOffset.bottomRight"),
              ),
            ),
            Container(
              color: Color(0xfff1f1f1),
              child: Align(
                alignment: Alignment.bottomLeft,
                widthFactor: 3,
                heightFactor: 2,
                child: Text("Alignment.bottomLeft"),
              ),
            ),
            Container(
              color: Color(0xfff1f1f1),
              margin: EdgeInsets.only(top: 10.0),
              child: Align(
                alignment: Alignment(0.4, 0.5),
                widthFactor: 3,
                heightFactor: 2,
                child: Text("Alignment(0.4, 0.5)"),
              ),
            ),

          ],
        )

      ),
    );
  }
}

/**
    const Align({
    Key key,
    this.alignment = Alignment.center,//对齐方式,系统预设了9种对齐方式，也可以自定义Alignment(0.4,0.5),
    其中第一个参数，-1.0是左边对齐，1.0是右边对齐，第二个参数，-1.0是顶部对齐，1.0是底部对齐。
    this.widthFactor,//宽是子组件的倍数,Align的宽度就是child的宽度乘以这个值
    this.heightFactor,//高是子组件的倍数,Align的高度就是child的高度乘以这个值
    Widget child
    })
 */
